<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>LinkedChat招聘网</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/public/static/css/Register.css">
    <script src="${pageContext.request.contextPath}/public/static/js/jquery-3.6.0.min.js"></script>
    <link href="${pageContext.request.contextPath}/public/static/images/login_icon.ico" rel="shortcut icon">
</head>
<body>
    <div class="img">
        <div class="log register">
            <div class="myk">
                <div id="logs">
                    注册
                </div>

                <!-- 登录身份选择 -->
                <div class="formItem3">
                    <input type="button" value="我要找工作" class="butto1">
<%--                    <input type="button" value="验证码注册" class="butto2" href="${pageContext.request.contextPath}/public/Person/CaptchRegister.jsp">--%>
                    <a href="${pageContext.request.contextPath}/public/Person/CaptchRegister.jsp"><input type="button" value="验证码注册" class="butto2"></a>
                </div>

                <!-- 手机号输入框  -->
                <div class="formItem2">
                    <label class="yonghu">手机号：</label>
                    <input type="text" id="Registertel" class="textinput userpho"placeholder="请输入手机号" ><!-- value="${result.data.personTel}" -->
                </div>
                <i class="msgTip2 userphoTip">  </i>

                <div class="formItem2">
                    <label  class="yonghu">用户名：</label>
                    <input type="text" id="Registername" class="textinput useremail"placeholder="请输入账户" >
                </div>
                <i class="msgTip2 useremailTip">  </i>

                <div class="formItem2">
                    <label  class="yonghu" >&nbsp;密&nbsp;&nbsp;码&nbsp;：</label>
                    <input id="Registerpassword" type="password"class="textinput userpwd" placeholder="请输入密码">
                </div>

                <i class="msgTip2 userpwdTip">  </i>

                <!-- 登录button -->
                <button id="Registerbutton" class="inputs submitBtn" ><a style="text-decoration: none;color: black;">注册</a></button>
                <div class="logi"><a href="${pageContext.request.contextPath}/public/Person/Login.jsp">已有账号？去登录</a></div>
            </div>

        </div>
    </div>

<script src="${pageContext.request.contextPath}/public/static/js/register.js"></script>
<script>

    var url = "${pageContext.request.contextPath}/personCenter/save";
    $("#Registerbutton").click(function (){
        var personTel = $("#Registertel").val();
        var personUsername = $("#Registername").val();
        var personPassword = $("#Registerpassword").val();
        var data="personTel= "+personTel+"&personUsername="+personUsername+"&personPassword="+personPassword;
        console.log(data)
        $.post(url,data,function(result){
            console.log("注册成功")
            window.alert(result.reason)
            sessionStorage.setItem("personTel",personTel)
            sessionStorage.setItem("personPassword",personPassword)
            window.location.href="${pageContext.request.contextPath}/public/Person/Login.jsp"
        });
    })

</script>

</body>
</html>
